home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Mark Pilgrim / Jotto ][ 1.2 / source / Wipes ƒ / Skipaline U-D 2-pass.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-30  |  1.3 KB  |  43 lines  |  [TEXT/MMCC]

  1. #include "timing.h"
  2.  
  3. #define CorrectTime 1
  4. #define theWindowWidth (boundsRect.right-boundsRect.left)
  5. #define theWindowHeight (boundsRect.bottom-boundsRect.top)
  6.  
  7. pascal short Skipaline2Pass(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect);
  8.  
  9. /* Copy even-numbered rows starting at the top and moving down, and copy odd-
  10.    numbered rows starting at the bottom and moving up. */
  11.    
  12. pascal short Skipaline2Pass(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect)
  13. {
  14.     Rect        thisone,thatone;
  15.     
  16.     SetRect(&thisone, boundsRect.left, boundsRect.top, boundsRect.right, boundsRect.top+1);
  17.     SetRect(&thatone, boundsRect.left, boundsRect.bottom-1, boundsRect.right, boundsRect.bottom);
  18.     if (theWindowHeight%2)
  19.         OffsetRect(&thatone, 0, -1);
  20.     
  21.     while (thisone.top<boundsRect.bottom)
  22.     {
  23.         StartTiming();
  24.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  25.             &thisone, &thisone, 0, 0L);
  26.         thisone.top+=2;             /* even row goes down by 2 */
  27.         thisone.bottom+=2;
  28.         TimeCorrection(CorrectTime);
  29.     }
  30.     
  31.     while (thatone.bottom>=boundsRect.top)
  32.     {
  33.         StartTiming();
  34.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  35.             &thatone, &thatone, 0, 0L);
  36.         thatone.top-=2;             /* odd row goes up by 2 */
  37.         thatone.bottom-=2;
  38.         TimeCorrection(CorrectTime);
  39.     }
  40.     
  41.     return 0;
  42. }
  43.